int LED01 = 27;

int brightness = 1; // 0 - 255
int fadeAmount = 1;

void setup() {
  ledcSetup(0, 100, 8);
  ledcAttachPin(LED01, 0);
}

void loop() {
  brightness = brightness + fadeAmount;
  if (brightness == 255 || brightness == 0) {
    fadeAmount = - fadeAmount;
  }
  ledcWrite(0, brightness);
  delay(10); // delay的时长可以控制呼吸频率，数字越大，呼吸越慢
}
